import Vue from 'vue';
import VueRouter from 'vue-router';


Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    redirect: '/login', // 重定向到 '/login'
       hidden: true // 隐藏
  },
  {
    path: '/login',
    name: 'Login',
      hidden: true, // 隐藏
    component: () => import('@/components/Login')
  },


    /* 学生管理*/
  {
    path: '/hello',
    name: '学生管理',
      iconClass: 'el-icon-s-home',
      redirect: '/hello/student',
    component: () => import('@/components/HelloWorld'),
    children: [
      {
        path: '/hello/student',
        name: '学生列表',
          iconClass: 'el-icon-user',
        component: () => import('@/components/students/StudentList')
      },
        {
            path: '/hello/stcourse',
            name: '课程信息',
            iconClass: 'el-icon-reading',
            component: () => import('@/components/students/Stcourse')
        },
        {
            path: '/hello/grade',
            name: '成绩管理',
            iconClass: 'el-icon-s-data',
            component: () => import('@/components/students/Grade.vue')
        },
        {
            path: '/hello/stdorm',
            name: '宿舍管理',
            iconClass: 'el-icon-s-home',
            component: () => import('@/components/students/StDorm.vue')
        }

    ]
  },

    /*数据分析*/
    {
        path: '/hello',
        name: '数据分析',
        iconClass: 'el-icon-edit-outline',
        component: () => import('@/components/HelloWorld'),
        children: [
            {
                path: '/hello/score',
                name: '分数地图',
                component: () => import('@/components/dataAnalsis/ScoreMap')
            },
            {
                path: '/hello/dataview',
                name: '数据概括',
                component: () => import('@/components/dataAnalsis/DateView')
            },
            {
                path: '/hello/mapview',
                name: '地图概览',
                component: () => import('@/components/dataAnalsis/MapView')
            },
            {
                path: '/hello/travel',
                name: '旅游地图',
                iconClass: 'fa fa-line-chart',
                component: () => import('@/components/dataAnalsis/TravelMap')
            },

        ]
        },
    /* 管理员管理 */
    {
        path: '/users',
        name: '管理员',
        iconClass: 'el-icon-user-solid',
        component: () => import('@/components/HelloWorld'),
        children: [
            {
                path: '/users/list',
                name: '管理员列表',
                component: () => import('@/components/users/UserList')  // 更改为修复后的组件名
            },
            {
                path: '/users/user',
                name: '权限管理',
                component: () => import('@/components/users/UserT')  // 保持不变，因为这两个路径使用相同的组件
            },
        ]
    }

];

const router = new VueRouter({
  mode: 'hash',
  routes
});

export default router;
